Public Class ThemSanBay
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents txtMaSanBay As System.Windows.Forms.TextBox
    Friend WithEvents txtTenSanBay As System.Windows.Forms.TextBox
    Friend WithEvents btnThem As System.Windows.Forms.Button
    Friend WithEvents btnThoat As System.Windows.Forms.Button
    Friend WithEvents btnTaoMoi As System.Windows.Forms.Button
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ThemSanBay))
        Me.Label1 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.txtMaSanBay = New System.Windows.Forms.TextBox
        Me.txtTenSanBay = New System.Windows.Forms.TextBox
        Me.btnThem = New System.Windows.Forms.Button
        Me.btnThoat = New System.Windows.Forms.Button
        Me.PictureBox1 = New System.Windows.Forms.PictureBox
        Me.btnTaoMoi = New System.Windows.Forms.Button
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("Times New Roman", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(163, Byte))
        Me.Label1.Location = New System.Drawing.Point(102, 8)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(346, 48)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "THÊM SÂN BAY"
        Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(62, 86)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(88, 23)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "Mã Sân Bay"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(62, 126)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(96, 23)
        Me.Label3.TabIndex = 2
        Me.Label3.Text = "Tên Sân Bay"
        '
        'txtMaSanBay
        '
        Me.txtMaSanBay.ForeColor = System.Drawing.Color.Blue
        Me.txtMaSanBay.Location = New System.Drawing.Point(174, 86)
        Me.txtMaSanBay.Name = "txtMaSanBay"
        Me.txtMaSanBay.Size = New System.Drawing.Size(239, 26)
        Me.txtMaSanBay.TabIndex = 0
        '
        'txtTenSanBay
        '
        Me.txtTenSanBay.ForeColor = System.Drawing.Color.Blue
        Me.txtTenSanBay.Location = New System.Drawing.Point(174, 126)
        Me.txtTenSanBay.Name = "txtTenSanBay"
        Me.txtTenSanBay.Size = New System.Drawing.Size(239, 26)
        Me.txtTenSanBay.TabIndex = 1
        '
        'btnThem
        '
        Me.btnThem.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(163, Byte))
        Me.btnThem.Location = New System.Drawing.Point(61, 186)
        Me.btnThem.Name = "btnThem"
        Me.btnThem.Size = New System.Drawing.Size(89, 32)
        Me.btnThem.TabIndex = 2
        Me.btnThem.Text = "Thêm"
        '
        'btnThoat
        '
        Me.btnThoat.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(163, Byte))
        Me.btnThoat.Location = New System.Drawing.Point(359, 186)
        Me.btnThoat.Name = "btnThoat"
        Me.btnThoat.Size = New System.Drawing.Size(89, 32)
        Me.btnThoat.TabIndex = 4
        Me.btnThoat.Text = "Thoát"
        '
        'PictureBox1
        '
        Me.PictureBox1.ErrorImage = Nothing
        Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
        Me.PictureBox1.Location = New System.Drawing.Point(8, 8)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(88, 56)
        Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.PictureBox1.TabIndex = 30
        Me.PictureBox1.TabStop = False
        '
        'btnTaoMoi
        '
        Me.btnTaoMoi.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(163, Byte))
        Me.btnTaoMoi.Location = New System.Drawing.Point(214, 186)
        Me.btnTaoMoi.Name = "btnTaoMoi"
        Me.btnTaoMoi.Size = New System.Drawing.Size(89, 32)
        Me.btnTaoMoi.TabIndex = 2
        Me.btnTaoMoi.Text = "Tạo Mới"
        '
        'ThemSanBay
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
        Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
        Me.ClientSize = New System.Drawing.Size(460, 237)
        Me.Controls.Add(Me.btnThoat)
        Me.Controls.Add(Me.btnTaoMoi)
        Me.Controls.Add(Me.btnThem)
        Me.Controls.Add(Me.PictureBox1)
        Me.Controls.Add(Me.txtTenSanBay)
        Me.Controls.Add(Me.txtMaSanBay)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ForeColor = System.Drawing.Color.Blue
        Me.Name = "ThemSanBay"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        Me.Text = "Thêm Sân Bay"
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region

    Private Sub btnThem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThem.Click

        'Kiểm Tra Các Ô Textbox
        If (Me.txtMaSanBay.Text = "") Then
            MsgBox("Chưa Nhập Mã Sân Bay !")
            txtMaSanBay.Focus()
            Exit Sub
        End If
        If (Me.txtTenSanBay.Text = "") Then
            MsgBox("Chưa Nhập Tên Sân Bay !")
            txtTenSanBay.Focus()
            Exit Sub
        End If

        'Lưu Thông Tin Sân Bay
        Dim sb As New SanBay
        sb.ThemSanBay(txtMaSanBay.Text, txtTenSanBay.Text)
        sb = Nothing
        MessageBox.Show("Đã Thêm 1 Sân Bay !")

    End Sub

    Private Sub btnTaoMoi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTaoMoi.Click

        'Xóa Các Ô Textbox
        txtMaSanBay.Text = ""
        txtTenSanBay.Text = ""
        txtMaSanBay.Focus()

    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub
End Class
